
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="Python">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>image_generator module &#8212; deepaugment 0.2.0 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="module-image_generator">
<span id="image-generator-module"></span><h1>image_generator module<a class="headerlink" href="#module-image_generator" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="image_generator.apply_default_transformations">
<code class="descclassname">image_generator.</code><code class="descname">apply_default_transformations</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/image_generator.html#apply_default_transformations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#image_generator.apply_default_transformations" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="image_generator.deepaugment_image_generator">
<code class="descclassname">image_generator.</code><code class="descname">deepaugment_image_generator</code><span class="sig-paren">(</span><em>X</em>, <em>y</em>, <em>policy</em>, <em>batch_size=64</em>, <em>augment_chance=0.5</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/image_generator.html#deepaugment_image_generator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#image_generator.deepaugment_image_generator" title="Permalink to this definition">¶</a></dt>
<dd><p>Yields batch of images after applying random augmentations from the policy</p>
<p>Each image is augmented by 50% chance. If augmented, one of the augment-chain in the policy is applied.
Which augment-chain to apply is chosen randomly.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>X (numpy.array):
labels (numpy.array):
policy (list): list of dictionaries</dd>
</dl>
<p>Returns:</p>
</dd></dl>

<dl class="function">
<dt id="image_generator.random_flip">
<code class="descclassname">image_generator.</code><code class="descname">random_flip</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/image_generator.html#random_flip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#image_generator.random_flip" title="Permalink to this definition">¶</a></dt>
<dd><p>Flip the input x horizontally with 50% probability.</p>
</dd></dl>

<dl class="function">
<dt id="image_generator.test_deepaugment_image_generator">
<code class="descclassname">image_generator.</code><code class="descname">test_deepaugment_image_generator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/image_generator.html#test_deepaugment_image_generator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#image_generator.test_deepaugment_image_generator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="image_generator.zero_pad_and_crop">
<code class="descclassname">image_generator.</code><code class="descname">zero_pad_and_crop</code><span class="sig-paren">(</span><em>img</em>, <em>amount=4</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/image_generator.html#zero_pad_and_crop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#image_generator.zero_pad_and_crop" title="Permalink to this definition">¶</a></dt>
<dd><p>Zero pad by <cite>amount</cite> zero pixels on each side then take a random crop.
Args:</p>
<blockquote>
<div>img: numpy image that will be zero padded and cropped.
amount: amount of zeros to pad <cite>img</cite> with horizontally and verically.</div></blockquote>
<dl class="docutils">
<dt>Returns:</dt>
<dd>The cropped zero padded img. The returned numpy array will be of the same
shape as <cite>img</cite>.</dd>
</dl>
</dd></dl>

</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">deepaugment</a></h1>








<h3>Navigation</h3>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2019, Baris Ozmen.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/image_generator.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>